home *** CD-ROM | disk | FTP | other *** search
- Path: casbah.acns.nwu.edu!muzaffar
- From: muzaffar@casbah.acns.nwu.edu (Usman Muzaffar)
- Newsgroups: comp.lang.c
- Subject: Re: A question about STRING.
- Date: 29 Jan 1996 19:24:28 GMT
- Organization: Northwestern University, Evanston IL
- Message-ID: <4ej6tc$svf@news.acns.nwu.edu>
- References: <4e0akh$853@erinews.ericsson.se>
- NNTP-Posting-Host: casbah.acns.nwu.edu
-
- In article <4e0akh$853@erinews.ericsson.se>,
- wei he (martletts) <etlwihe@etlxdmx.ericsson.se> wrote:
- >Hi there,
- >
- >I have a problem with 'C' and need your help.
- >
- >In my program, there is a variable MUTLI_RECORDS defined as char, which has a
- >typical string as following:
- >
- >1,0,a,map010017000802532236,1,pp,0.2,1,0,map010017000802532236,acc,1,0. ...
- >
- >In fact, this string contains many records. Each record contains seven columns.
- >The columns in each record are seperated by the comma ','. Each record is
- >terminated by a full stop '.'.
- >
- >What I want to do is to have a loop. In each loop, one record is extracted
- >from the MULTI_RECORDS and the different columns in this record are assigned to
- >different variables.
- >
- >As the program is to run on a real time system, I have to keep the loops equal
- >to the number of records hold in the MULTI_RECORDS, no inner loop is allowed.
-
- Doesn't the strtok function in the standard library do just this for you?
- Split up an incoming string into tokens, and assign one to each.
- Although, a simple while loop could do the trick, too.
-
-
-